<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<% String path=request.getContextPath(); %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>MIS-<s:property value="#session.currentUser.getUsername()" /></title>
		<link href="<s:url value="/style.css"/>" rel="stylesheet" type="text/css"/>
		<style>
			
		</style>
	</head>
	<body>
	<jsp:include page="/navigation/navigation.jsp"/>
	<div id="mainBox">
		<div id="mainLeft">
		<h4>Pending Appointments:</h4>
			<table id="appTable">
			<col width="50" />
			<col width="120" />
			<col width="120" />
			<col width="120" />
			<col width="100" />
			<col width="100" />
				<thead>
					<tr>
						<th>Date</th>
						<th>StartTime</th>		
						<th>EndTime</th>
						<th>Doctor</th>
						<th>Location</th>
						<th>Details</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="patientAppointment">
					<tr>
						<td><s:property value="appointmentDate" /></td>
						<td><s:property value="startTime" /></td>
						<td><s:property value="EndTime" /></td>
						<td><s:property value="doctor.getName()" /></td>
						<td><s:property value="location" /></td>
						<td><a href="<s:url action='initAppointmentViewPage'><s:param name="selectedAppointmentId" value="%{appointmentId}" /></s:url>">details</a></td>
					</tr>
					</s:iterator>
				</tbody>
			</table>
			</div>
			
			<div id = "mainRight">
			<h4>Patient Information:</h4>
				<table>
					<tbody>
						<tr>
							<td><img id = "userImage" src = "<s:url value="/resources/user.png" />" width=100px height=120px alt="404 Not Found"></td>
						</tr>
						<tr>
							<td id="title">Id:</td>
							<td><s:property value="#session.currentUser.getId()" /></td>
						</tr>
						<tr>
							<td id="title">Name:</td>
							<td><s:property value="#session.currentUser.getName()" /></td>
						</tr>
						<tr>
							<td id="title">Doctor:</td>
							<td><s:property value="#session.defaultDoctorName" /></td>
						</tr>
						<tr>
							<td id="title">Phone:</td>
							<td><s:property value="#session.currentUser.getPhone()" /></td>
						</tr>
						<tr>
							<td id="title">Address:</td>
							<td><s:property value="#session.currentUser.getAddress()" /></td>
						</tr>
						<tr>
							<td id="title">OHIP:</td>
							<td><s:property value="#session.currentUser.getOhip()" /></td>
						</tr>
						<tr>
							<td id="title">SIN:</td>
							<td><s:property value="#session.currentUser.getSin()" /></td>
						</tr>
					</tbody>
				</table>
				
				<a href="<s:url action='initPatientUpdatePage'><s:param name="selectedPatientId" value="%{#session.currentUser.getId()}" /></s:url>">Edit Info</a>
				
			</div>
		</div>
	</body>
</html>